home *** CD-ROM | disk | FTP | other *** search
/ Programming Languages Suite / ProgramD2.iso / Borland / Borland C++ V5.02 / CLASSSRC.PAK / EXBASE.CPP < prev    next >
C/C++ Source or Header  |  1997-05-06  |  862b  |  53 lines

  1. //----------------------------------------------------------------------------
  2. // Borland WinSys Library
  3. // Copyright (c) 1994, 1997 by Borland International, All rights
  4. //
  5. //$Revision:   5.6  $
  6. //
  7. // TXBase class implementation.
  8. //----------------------------------------------------------------------------
  9. #include <winsys/pch.h>
  10. #include <winsys/exbase.h>
  11.  
  12. int TXBase::InstanceCount = 0;
  13.  
  14. TXBase::TXBase(const string& msg)
  15. :
  16.   xmsg(msg)
  17. {
  18.   InstanceCount++;
  19. }
  20.  
  21. TXBase::TXBase(const TXBase& src)
  22. :
  23.   xmsg(src)
  24. {
  25.   InstanceCount++;
  26. }
  27.  
  28. TXBase::~TXBase()
  29. {
  30.   InstanceCount--;
  31. }
  32.  
  33. TXBase*
  34. TXBase::Clone()
  35. {
  36.   return new TXBase(*this);
  37. }
  38.  
  39. void
  40. TXBase::Throw()
  41. {
  42.   THROW( *this );
  43. }
  44.  
  45. //
  46. // Construct a TXBase exception from scratch, and throw it
  47. //
  48. void
  49. TXBase::Raise(const string& msg)
  50. {
  51.   TXBase(msg).Throw();
  52. }
  53.